﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package reprise.utils {
    import reprise.commands.*;

    public class Delegate extends AbstractCommand {

        protected var m_scope:Object;
        protected var m_args:Array;
        protected var m_method:Function;

        public function Delegate(_arg1:Object, _arg2:Function, _arg3:Array=null){
            m_scope = _arg1;
            m_method = _arg2;
            m_args = _arg3;
        }
        public function setScope(_arg1:Object):void{
            m_scope = _arg1;
        }
        public function scope():Object{
            return (m_scope);
        }
        override public function execute(... _args):void{
            var _local2:Array = _args.concat(m_args).concat(this);
            m_method.apply(m_scope, _local2);
            m_didSucceed = true;
        }
        public function arguments():Array{
            return (m_args);
        }
        public function setArguments(_arg1:Array):void{
            m_args = _arg1;
        }

        public static function create(_arg1:Object, _arg2:Function, ... _args):Delegate{
            return (new Delegate(_arg1, _arg2, _args));
        }

    }
}//package reprise.utils 
